package book.ch3.example9;

public class test {

	public static void main(String[] args) {
		a a1=new a();
		System.out.println(a1.x);
		a a2=new a(5);
		System.out.println(a2.x);
		sa sa1=new sa();
		System.out.println(sa1.x);
		sb sb1=new sb();
		System.out.println(sb1.x);
		sb sb2=new sb(5);
		System.out.println(sb2.x);
		sb sb3=new sb(5,100);
		System.out.println(sb3.x);
		ssb ssb1=new ssb();
		System.out.println(ssb1.x);
	}

}
class a{
	int x=1;
	a(){
		x=10;
	}
	a(int p1){
		x+=p1;
	}
}
class sa extends a{
	
}
class sb extends a{
	sb(){
		x=x+3;
	}
	sb(int p1){
		x+=p1;
	}
	sb(int p1,int p2){
		super(p1);
		x+=p2;
	}
}
class ssb extends sb{
	ssb(){
		x+=6;
	}
}